package com.xuxin.baby.activity;

import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.recyclerview.widget.RecyclerView;

import com.blankj.utilcode.util.ActivityUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.scwang.smart.refresh.layout.SmartRefreshLayout;
import com.xuxin.baby.R;
import com.xuxin.baby.adapter.ClassGrowthAdapter;
import com.xuxin.baby.base.BaseActivity;
import com.xuxin.baby.utils.RecycleUtils;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * Created by xu_xin
 * Created on 2020.08.20 0020
 * 发育评测 -> 生长发育
 */
public class ClassGrowthActivity extends BaseActivity {
    @BindView(R.id.title_left)
    ImageView title_left;
    @BindView(R.id.title_right)
    ImageView title_right;
    @BindView(R.id.title_name)
    TextView title_name;
    @BindView(R.id.smart_refresh)
    SmartRefreshLayout smart_refresh;
    @BindView(R.id.smart_recycle)
    RecyclerView smart_recycle;

    @Override
    public void setContentView() {
        setContentView(R.layout.activity_smart);
    }

    @Override
    public void initView() {
        title_name.setText("生长发育");
        smart_refresh.setEnableRefresh(false);
        smart_refresh.setEnableLoadMore(false);
        RecycleUtils.init(smart_recycle);
        ClassGrowthAdapter myAdapter = new ClassGrowthAdapter();
        smart_recycle.setAdapter(myAdapter);
        myAdapter.setOnItemClickListener((adapter, view, position) -> {
            switch (position) {
                case 0:
                    ActivityUtils.startActivity(ChildDataActivity.class);
                    break;
                case 1:
                    ActivityUtils.startActivity(ChildTargetActivity.class);
                    break;
                case 2:
                    ActivityUtils.startActivity(ChildRiskActivity.class);
                    break;
                case 3:
                    ToastUtils.showShort("功能完善中...");
                case 4:
                    ToastUtils.showShort("功能完善中...");
                    break;
            }
        });
    }

    @Override
    public void initData() {
    }

    @Override
    public void onComplete() {

    }

    @Override
    @OnClick({R.id.title_left})
    public void onClick(View view) {
        int id = view.getId();
        if (id == R.id.title_left) {
            finish();
        }
    }
}